package xyz.cerberu.cet.global.utils;

import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.*;
import java.util.Properties;

/**
 * @Name β世界
 * Created on 13:27
 * @Description properties参数读取
 */
public class PropertiesUtils extends PropertiesLoaderUtils {

    public static Properties getProperties(File file){
        Properties properties = new Properties();
        try {
            InputStream is = new BufferedInputStream(new FileInputStream(file));
            BufferedReader bf = new BufferedReader(new  InputStreamReader(is,"UTF-8"));
            properties.load(bf);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties;
    }

}
